<template>
	<view >
	

	</view>
</template>

<script setup>
	import {
getXcxurl
	} from '../../api/index.js'
	export default {
		data() {
			return {
				url: "",
			param:"",
			mobile:""

			};
		},
		methods: {
			changes() {



			}
		},

		onLoad(option) {
			// uni.makePhoneCall({
			// 	phoneNumber: '4008825010'
			// })
			if(option.a){
				this.a=option.a
			}
if(option.mobile){
				this.mobile=option.mobile
			}
			if(option.param){
				this.param=option.param
			}
			if(option.qcjParamStr){
				this.param=option.qcjParamStr
			}
			if(option.jtcAdRequestId){
				this.param=option.jtcAdRequestId
			}
			if(option.adId){
				this.param=option.adId
			}
			if(option.tokenId){
				this.param=option.tokenId
			}
			if(option.tokenid){
				this.param=option.tokenid
			}
			if(option.clickId){
				this.param=option.clickId
			}
			if(option.clickid){
				this.param=option.clickid
			}
			if(option.pushid){
				this.param=option.pushid
			}
			if(option.push_id){
				this.param=option.push_id
			}
			if (option.union_site) {
				this.param=(window.location.href)
			}
			if(option.bxm_id){
				this.param=option.bxm_id
			}
			
			
			if(option.requestId){
				console.log(option.requestId)
				let a={
					'requestId':option.requestId,
					'adId':option.adId,
					'pn':option.pn
				}
				console.log(a)
				if(a.requestId==null||a.requestId==undefined||a.requestId=='null'){
					a.requestId=''
				}
				if(a.adId==null||a.adId==undefined||a.adId=='null'){
					a.adId=''
				}
				if(a.pn==null||a.pn==undefined||a.pn=='null'){
					a.pn=''
				}
				
				this.param(JSON.stringify(a))
				
			}
			if(option.projectid){
			
				this.param=(window.location.href)
				
			}
			if(option.creativeid){
			
			this.param=(window.location.href)
				
			}
		if(option.page){
			let prams={
				path:option.page,
				appid:'wxd288833c4af82e86',
			
				query:"a="+this.a+'&param='+encodeURIComponent(this.param),
				envVersion:"release"
			}
			if(option.mobile){
				prams.query += '&mobile=' + option.mobile
			}
			if(option.p){
				prams.query += '&p=' + option.p
			}
			if(option.s){
				prams.query += '&s=' + option.s
			}
			getXcxurl(prams).then((res)=>{
					console.log(res)
				window.location.href=res.data
			})
		}	
	
	
		}
	}
</script>

<style lang="scss" scoped>

</style>